package org.dnd.rcp.editor.text;

import java.io.File;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

/**
 * Editor Input
 * 
 * @author dendy
 * 
 */
public class EditorInput implements IEditorInput {

	private File file;

	public EditorInput(File file) {
		this.file = file;
	}

	public boolean exists() {
		if (file == null)
			return false;
		return file.exists();
	}

	public ImageDescriptor getImageDescriptor() {
		return null;
	}

	public String getName() {
		if (file == null)
			return "";
		return file.getName();
	}

	public IPersistableElement getPersistable() {
		return null;
	}

	public String getToolTipText() {
		if (file == null)
			return "";
		return file.getAbsolutePath();
	}

	@SuppressWarnings("rawtypes")
	public Object getAdapter(Class adapter) {
		return null;
	}

	public File getFile() {
		return file;
	}
}
